home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-03-06 | 3.6 KB | 133 lines | [TEXT/GEOL] |
- Item forwarded by MARRIOTT1 to BOYD3
-
- Item 0993865 9-May-88 17:13
-
- From: N0658 ESL, Robert Penland, ASC
-
- To: MACAPP$ MacApp Interest List
-
- cc: MACDTS Macintosh Developer Technical Supt.
-
- Sub: Appletalk in MacApp
-
- Hi again,
-
-
-
- My further adventures into the implementation of the new
- appletalk calls in a MacApp unit continue unchecked. Things are
- basically working but the speed is very S--L--O--W. The rate at
- which a call completes seems to be tied to the timeout value
- eventhough I am requesting and sending the proper number of
- packets. Could it be the way I am sensing the Appletalk events.
- Below are some code fragments from my Appletalk library. Is
- this an acceptable polling method and will it be called often
- enough?
-
-
-
- {EventHandler Methods}
-
- ------------------------------------------------------
-
- PROCEDURE TModTalkHandler.DoIdle(phase: IdlePhase);
-
- BEGIN
- IF fPollForCompletion THEN
- BEGIN
- PollForCompletion;
- END;
- END;
-
-
-
-
-
- PROCEDURE TModTalkHandler.PollForCompletion;
-
- {checks for completion of reception of reply from AppleTalk
-
- Request call; by default, this is called during Idle}
-
-
-
- PROCEDURE CheckIt(aTalkCall: TModTalkCall);
- BEGIN
- aTalkCall.CheckCompletion(FALSE);
- END;
-
-
-
- -----------------------------------------------------
-
- {TalkCall Method}
-
-
-
- PROCEDURE TModTalkCall.CheckCompletion (AsyncProcess:BOOLEAN);
-
- VAR aResult: INTEGER;
- BEGIN
- IF AsyncProcess THEN
- BEGIN
- aResult := fATPPBPtr^.ioResult;
- fTalkHandler.fHeadTalkCall := SELF;
- IF aResult = kCompleted THEN
- BEGIN
- fTalkHandler.CallSucceeded;
- END
- ELSE
- fTalkHandler.CallFailed(aResult);
- END
- ELSE
- IF fPending THEN
- BEGIN
- aResult := fATPPBPtr^.ioResult;
- IF aResult <> kStillPending THEN
- BEGIN
- fTalkHandler.fHeadTalkCall := SELF;
- fPending := FALSE;
- IF aResult = kCompleted THEN
- BEGIN
- fTalkHandler.CallSucceeded
- END
- ELSE
- fTalkHandler.CallFailed(aResult);
-
- END;
- END;
-
- END;
-
- --------------------------------------------------------
-
-
- This follows the architecture of the original MacApp appletalk unit
- with a few changes (parameter blocks are used and polling is the only
- method to determine completion, i.e. no Network events)
-
- The value passed to checkCompletion tells whether the call was
- asynchronous or not. If it was synchronous checkcompletion is
- called with AsyncProcess = TRUE under the assumption that the
- completion result is already in the ioResult field of the
- ATPParamBlock (given by fATPPBPtr). It the call was made
- asynchronously then checkcompletion is called by the doidle
- method with AsyncProcess= FALSE, which continually checks
- the ioResult field. Is this a reasonable approach? Also, is there
- something I need to change in MacApp so that it ignores Network
- events?
-
- As an aside, what happens to an appletalk call made to a
- computer that is involved in a very lengthy disk I/O procedure.
- Also, does the timeout value for a call set some kind of priority
- level for the event?
-
-
-
- Thanks,
-
- Robert Penland
-
-
-
-